<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    <script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
    <link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css">
    
    <style type="text/css">
    	.formTable_tr{
    		font-size: 14px;
    	}
    	
    	.formTable_tr td{
    		text-align: center;
    	}
    </style>
    
</head>
<body>
<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/inhospitalDisease.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0" >科室统计</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table" style="position: relative; z-index: 999;">
                <ul class="clearfix" style="margin-bottom:0;">
                    <li class="Label_1" >出院日期：&nbsp;</li>
                    <li class="Label_4" style="text-align:left;padding-left:3px;width:280px">

                    	<input class="Wdate input" style="width:120px;" type="text"  name='startTime' id='outHospitalStartDate' value='' onFocus="WdatePicker()" />
                    	<span>&nbsp;-&nbsp;</span>
                    	<input class="Wdate input" type="text" style="width:120px;"  name='endTime' id='outHospitalEndTime' value='' onFocus="WdatePicker()" />
                    </li>
                    
                  <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="tj()">统计</a>
                        </div>
                    </li>
                    
                </ul>
            </div>
		<table class="Search_tableList" cellpadding="0" cellspacing="0">

			<tr>
				<th class="tdLabel_4">出院科室</th>
				<th class="tdLabel_4">出院人数</th>
				<th class="tdLabel_4">死亡人数</th>
				<th class="tdLabel_4">平均住院天数</th>
				<th class="tdLabel_4">手术治疗及操作人数</th>
			</tr>
			<tbody id="tbody">
			<!-- <tr>
				<td class="tdLabel_5">101011-呼吸内科病房[中心院区]</td>
				<td class="tdLabel_5">30</td>
				<td class="tdLabel_5">1</td>
				<td class="tdLabel_5">11.0</td>
				<td class="tdLabel_5">85</td>
			</tr> -->
			</tbody>
		</table>

</div>
</div>

</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">

 function tj(){
	 var outHospitalStartTime=$("#outHospitalStartDate").val();
	 var outHospitalEndTime=$("#outHospitalEndDate").val();
	 
	 $.ajax({
		 type:"post",
		 url:'${basePath}/retrieval/getMedRecordStatisByOffice',
		 data:{outHospitalStartTime:outHospitalStartTime,outHospitalEndTime:outHospitalEndTime},
		 dataType:"json",
		 success:function(data){
			   console.log(data)
			 if(data.success){
				 var dataList=data.data;
				 if(dataList.length){
					 var html="";
					 $.each(dataList,function(i,item){
						 html+='<tr>'+
							'<td class="tdLabel_5">'+item.outDeptName+'</td>'+
							'<td class="tdLabel_5">'+item.outHospitalCount+'</td>'+
							'<td class="tdLabel_5">'+item.deathCount+'</td>'+
							'<td class="tdLabel_5">'+item.inHospitalAvgDays+'</td>'+
							'<td class="tdLabel_5">'+item.operateCount+'</td>'+
						    '</tr>'
					 });
					 $("#tbody").html("").html(html);
				 }else{
					 layer.alert("查询的数据为空！",{icon:5});
				 }
			 }else{
				 layer.alert("查询失败!",{icon:5});
				 $("#tbody").html("");
			 }
		 	 
/* =======
		 success:function(result){
			 console.log(result)	 
			 if (result.success) {
				 var list = result.data;
				 var content = "";
				 
				 $.each(list, function(index, item) {
					 //出院科室
					 var outDeptName = item.outDeptName!=null&&item.outDeptName!=''?item.outDeptName:'';
					 //平均住院天数
					 var inHospitalAvgDays = item.inHospitalAvgDays!=null?item.inHospitalAvgDays:'';
					 
					 content+="<tr>"
					 content+="<td class='tdLabel_5'>"+outDeptName+"</td>";
					 content+="<td class='tdLabel_5'>"+item.outHospitalCount+"</td>";
					 content+="<td class='tdLabel_5'>"+item.deathCount+"</td>";
					 content+="<td class='tdLabel_5'>"+inHospitalAvgDays+"</td>";
					 content+="<td class='tdLabel_5'>"+item.operateCount+"</td>";
					 content+="</tr>";
				 });
				 
				 $("#tbody").html("");
				 $("#tbody").html(content)
			 } else {
				 alert(result.msg);
			 }
>>>>>>> .r378 */
		 }
	 })
 }

</script>
</body>
</html>